import request from "@/utils/request";
import { export_table_to_excel } from "@/vendor/Export2Excel";

class LoginApi {
  static netRegist(data) {
    return request({
      url: "/api/YzUser/save",
      method: "post",
      data
    });
  }

  static loginByUsername(username, password, code) {
    const data = {
      username,
      password,
      code
    };
    return request({
      url: '/api/YzUser/login',
      // url: "/auth/login",
      method: "post",
      data
    });
  }

  static logout() {
    return request({
      url: "/auth/logout",
      method: "post"
    });
  }

  static getUserInfo(token) {
    return request({
      url: "/auth/info",
      method: "get",
      params: { token }
    });
  }

  static getKaptcha() {
    return request({
      url: "/auth/kaptcha",
      method: "get"
    });
  }
}


export default LoginApi;